<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>NumCpp: nc::Timer&lt; TimeUnit &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NumCppLogoDoxygen.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">NumCpp
   &#160;<span id="projectnumber">2.4.0</span>
   </div>
   <div id="projectbrief">A Templatized Header Only C++ Implementation of the Python NumPy Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classnc_1_1_timer.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">nc::Timer&lt; TimeUnit &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A timer class for timing code execution.  
 <a href="classnc_1_1_timer.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_timer_8hpp_source.html">Timer.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a968ad8ca046ae73671e211e644682c8d"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a968ad8ca046ae73671e211e644682c8d">ChronoClock</a> = std::chrono::high_resolution_clock</td></tr>
<tr class="separator:a968ad8ca046ae73671e211e644682c8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29e54a50e709622942a33e70b1b1e8f6"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a29e54a50e709622942a33e70b1b1e8f6">TimePoint</a> = std::chrono::time_point&lt; <a class="el" href="classnc_1_1_timer.html#a968ad8ca046ae73671e211e644682c8d">ChronoClock</a> &gt;</td></tr>
<tr class="separator:a29e54a50e709622942a33e70b1b1e8f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5dabfba271b3655326e46c633eabd70e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a5dabfba271b3655326e46c633eabd70e">Timer</a> ()</td></tr>
<tr class="separator:a5dabfba271b3655326e46c633eabd70e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ede5d1d2cdf6b97bec93b0954ddb610"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a4ede5d1d2cdf6b97bec93b0954ddb610">Timer</a> (const std::string &amp;inName)</td></tr>
<tr class="separator:a4ede5d1d2cdf6b97bec93b0954ddb610"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a88dd680a63b38ae9989a40878a8fd65b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a88dd680a63b38ae9989a40878a8fd65b">setName</a> (const std::string &amp;inName)</td></tr>
<tr class="separator:a88dd680a63b38ae9989a40878a8fd65b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fec514ed605a11c6e1c321041960d7e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a9fec514ed605a11c6e1c321041960d7e">sleep</a> (<a class="el" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a> length)</td></tr>
<tr class="separator:a9fec514ed605a11c6e1c321041960d7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a08ec3e6ba7a7979cb9e72d0cf3f2f7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a4a08ec3e6ba7a7979cb9e72d0cf3f2f7">tic</a> () noexcept</td></tr>
<tr class="separator:a4a08ec3e6ba7a7979cb9e72d0cf3f2f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a317fde3b5e7444328adf6484e0ec832e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacenc.html#a773f8535ba713f886e9e1b8378f6d76d">uint64</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classnc_1_1_timer.html#a317fde3b5e7444328adf6484e0ec832e">toc</a> (bool printElapsedTime=true)</td></tr>
<tr class="separator:a317fde3b5e7444328adf6484e0ec832e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename TimeUnit = std::chrono::milliseconds&gt;<br />
class nc::Timer&lt; TimeUnit &gt;</h3>

<p>A timer class for timing code execution. </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a968ad8ca046ae73671e211e644682c8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a968ad8ca046ae73671e211e644682c8d">&#9670;&nbsp;</a></span>ChronoClock</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::<a class="el" href="classnc_1_1_timer.html#a968ad8ca046ae73671e211e644682c8d">ChronoClock</a> =  std::chrono::high_resolution_clock</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a29e54a50e709622942a33e70b1b1e8f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29e54a50e709622942a33e70b1b1e8f6">&#9670;&nbsp;</a></span>TimePoint</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::<a class="el" href="classnc_1_1_timer.html#a29e54a50e709622942a33e70b1b1e8f6">TimePoint</a> =  std::chrono::time_point&lt;<a class="el" href="classnc_1_1_timer.html#a968ad8ca046ae73671e211e644682c8d">ChronoClock</a>&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a5dabfba271b3655326e46c633eabd70e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5dabfba271b3655326e46c633eabd70e">&#9670;&nbsp;</a></span>Timer() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::<a class="el" href="classnc_1_1_timer.html">Timer</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Constructor </p>

</div>
</div>
<a id="a4ede5d1d2cdf6b97bec93b0954ddb610"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ede5d1d2cdf6b97bec93b0954ddb610">&#9670;&nbsp;</a></span>Timer() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::<a class="el" href="classnc_1_1_timer.html">Timer</a> </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>inName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Constructor</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">inName</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a88dd680a63b38ae9989a40878a8fd65b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88dd680a63b38ae9989a40878a8fd65b">&#9670;&nbsp;</a></span>setName()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::setName </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>inName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sets/changes the timer name</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">inName</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9fec514ed605a11c6e1c321041960d7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fec514ed605a11c6e1c321041960d7e">&#9670;&nbsp;</a></span>sleep()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::sleep </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="namespacenc.html#af0f49663fb63332596e2e6327009d581">uint32</a>&#160;</td>
          <td class="paramname"><em>length</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Sleeps the current thread</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">length</td><td>the length of time to sleep </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4a08ec3e6ba7a7979cb9e72d0cf3f2f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a08ec3e6ba7a7979cb9e72d0cf3f2f7">&#9670;&nbsp;</a></span>tic()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::tic </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Starts the timer </p>

</div>
</div>
<a id="a317fde3b5e7444328adf6484e0ec832e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a317fde3b5e7444328adf6484e0ec832e">&#9670;&nbsp;</a></span>toc()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename TimeUnit  = std::chrono::milliseconds&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="namespacenc.html#a773f8535ba713f886e9e1b8378f6d76d">uint64</a> <a class="el" href="classnc_1_1_timer.html">nc::Timer</a>&lt; TimeUnit &gt;::toc </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>printElapsedTime</em> = <code>true</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Stops the timer</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">printElapsedTime</td><td>bool whether or not to print the elapsed time to the console </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ellapsed time in specified time units </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_timer_8hpp_source.html">Timer.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacenc.html">nc</a></li><li class="navelem"><a class="el" href="classnc_1_1_timer.html">Timer</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
